
<?php get_main_menu("receptionist") ?>
<?php
mysql_select_db($database_drycleaners_conn, $drycleaners_conn);
$query_customer = "SELECT person.first_name,
       person.last_name,
       contact.email,
       contact.phone_no,
       customer.id,
       location.plot_no,
       location.town,
       location.village
  FROM    (   (   drycleaners.customer customer
               INNER JOIN
                  drycleaners.contact contact
               ON (customer.contact_id = contact.id))
           INNER JOIN
              drycleaners.location location
           ON (customer.location_id = location.id))
       INNER JOIN
          drycleaners.person person
       ON (customer.person_id = person.id) 
	   ";
$customer = mysql_query($query_customer, $drycleaners_conn) or die(mysql_error());
$row_customer = mysql_fetch_assoc($customer);
$totalRows_customer = mysql_num_rows($customer);
?>
<?php include"includes/table_settings.php"?>        
  <div>
  <a href="."><img src="images/back-button.png" width="30" height="30" title="Back" /></a><a href=".?customer_add&action=Add">
  <img src="images/add-button.jpg" width="30" height="30" title="Add <?php echo $object_name ?>" /></a></div> 
      <div class="module_title">Customers
  </div>
  <table cellpadding="0" cellspacing="0" border="0" id="dataTable">
                <thead>
                  <tr>
                    <th>Id</th>
                    <th>Names</th>
                    <th>Location</th>
                    <th>Email</th>
                    <th>Phone No</th>
                    <th>Created Date</th>
                    <th></th>
                    <th></th>
                  </tr>
                </thead>
                <tbody>
                  <!--Loop start, you could use a repeat region here-->
  <?php do{?>
    <!--Loop start, you could use a repeat region here-->
    <tr>
    <td><?php echo $row_customer['id']?></td>
      <td><?php echo $row_customer['first_name']." ".$row_customer['last_name']?></td>
      <td><?php echo $row_customer['village']."-".$row_customer['town']?></td>
      <td><?php echo $row_customer['email']?></td>
      <td><?php echo $row_customer['phone_no']?></td>
      <td><?php echo $row_customer['created_date']?></td>
           <td><a href=".?customer= &amp;customer_edit= true&amp;id=<?php echo $row_customer['id']; ?>"><input name="" value="Edit" type="submit" id="edit_forms"/></a></td>
                      <td><a href=".?customer_delete&id=<?php echo $row_customer['id']; ?>"><input name="" value="Delete" type="submit" id="delete_forms"/></a></td>
    </tr>
    <?php }while($row_customer = mysql_fetch_assoc($customer));?>
                  <!--Loop end-->
                </tbody>
              </table>

<?php
mysql_free_result($customer);
?>